<?php
	require_once ("db_connection.php");

	$date = date("Y-m-d H:i:s");
	$affiliateid = $_POST['affiliateid'];
	
	
	/* start  add to afservices table */
		$id = "RM-" . uniqid();
		$services = mysql_real_escape_string($_POST["services"]);
		
		$query = "INSERT INTO afservices(servicesid,affiliateid,services,date)
		VALUES('$id','$affiliateid','$services','$date')";
		
		if(!mysql_query($query, $con)){
			die('Error: '. mysql_error());
		}
	/* end  -------- */	


	echo "Saved! ";
	flush();
	mysql_close($con);
?>